// Copyright 2018-2021 Polyaxon, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*
 * Polyaxon SDKs and REST API specification.
 * Polyaxon SDKs and REST API specification.
 *
 * The version of the OpenAPI document: 1.7.4
 * Contact: contact@polyaxon.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package org.openapitools.client.api;

import org.openapitools.client.ApiCallback;
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.ApiResponse;
import org.openapitools.client.Configuration;
import org.openapitools.client.Pair;
import org.openapitools.client.ProgressRequestBody;
import org.openapitools.client.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import org.openapitools.client.model.RuntimeError;
import org.openapitools.client.model.V1ListSearchesResponse;
import org.openapitools.client.model.V1Search;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ProjectSearchesV1Api {
    private ApiClient localVarApiClient;

    public ProjectSearchesV1Api() {
        this(Configuration.getDefaultApiClient());
    }

    public ProjectSearchesV1Api(ApiClient apiClient) {
        this.localVarApiClient = apiClient;
    }

    public ApiClient getApiClient() {
        return localVarApiClient;
    }

    public void setApiClient(ApiClient apiClient) {
        this.localVarApiClient = apiClient;
    }

    /**
     * Build call for createProjectSearch
     * @param owner Owner of the namespace (required)
     * @param project Project under namesapce (required)
     * @param body Search body (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call createProjectSearchCall(String owner, String project, V1Search body, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/api/v1/{owner}/{project}/searches"
            .replaceAll("\\{" + "owner" + "\\}", localVarApiClient.escapeString(owner.toString()))
            .replaceAll("\\{" + "project" + "\\}", localVarApiClient.escapeString(project.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call createProjectSearchValidateBeforeCall(String owner, String project, V1Search body, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'owner' is set
        if (owner == null) {
            throw new ApiException("Missing the required parameter 'owner' when calling createProjectSearch(Async)");
        }
        
        // verify the required parameter 'project' is set
        if (project == null) {
            throw new ApiException("Missing the required parameter 'project' when calling createProjectSearch(Async)");
        }
        
        // verify the required parameter 'body' is set
        if (body == null) {
            throw new ApiException("Missing the required parameter 'body' when calling createProjectSearch(Async)");
        }
        

        okhttp3.Call localVarCall = createProjectSearchCall(owner, project, body, _callback);
        return localVarCall;

    }

    /**
     * Create project search
     * 
     * @param owner Owner of the namespace (required)
     * @param project Project under namesapce (required)
     * @param body Search body (required)
     * @return V1Search
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public V1Search createProjectSearch(String owner, String project, V1Search body) throws ApiException {
        ApiResponse<V1Search> localVarResp = createProjectSearchWithHttpInfo(owner, project, body);
        return localVarResp.getData();
    }

    /**
     * Create project search
     * 
     * @param owner Owner of the namespace (required)
     * @param project Project under namesapce (required)
     * @param body Search body (required)
     * @return ApiResponse&lt;V1Search&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<V1Search> createProjectSearchWithHttpInfo(String owner, String project, V1Search body) throws ApiException {
        okhttp3.Call localVarCall = createProjectSearchValidateBeforeCall(owner, project, body, null);
        Type localVarReturnType = new TypeToken<V1Search>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Create project search (asynchronously)
     * 
     * @param owner Owner of the namespace (required)
     * @param project Project under namesapce (required)
     * @param body Search body (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call createProjectSearchAsync(String owner, String project, V1Search body, final ApiCallback<V1Search> _callback) throws ApiException {

        okhttp3.Call localVarCall = createProjectSearchValidateBeforeCall(owner, project, body, _callback);
        Type localVarReturnType = new TypeToken<V1Search>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for deleteProjectSearch
     * @param owner Owner of the namespace (required)
     * @param entity Entity: project name, hub name, registry name, ... (required)
     * @param uuid Uuid identifier of the sub-entity (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call deleteProjectSearchCall(String owner, String entity, String uuid, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/api/v1/{owner}/{entity}/searches/{uuid}"
            .replaceAll("\\{" + "owner" + "\\}", localVarApiClient.escapeString(owner.toString()))
            .replaceAll("\\{" + "entity" + "\\}", localVarApiClient.escapeString(entity.toString()))
            .replaceAll("\\{" + "uuid" + "\\}", localVarApiClient.escapeString(uuid.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call deleteProjectSearchValidateBeforeCall(String owner, String entity, String uuid, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'owner' is set
        if (owner == null) {
            throw new ApiException("Missing the required parameter 'owner' when calling deleteProjectSearch(Async)");
        }
        
        // verify the required parameter 'entity' is set
        if (entity == null) {
            throw new ApiException("Missing the required parameter 'entity' when calling deleteProjectSearch(Async)");
        }
        
        // verify the required parameter 'uuid' is set
        if (uuid == null) {
            throw new ApiException("Missing the required parameter 'uuid' when calling deleteProjectSearch(Async)");
        }
        

        okhttp3.Call localVarCall = deleteProjectSearchCall(owner, entity, uuid, _callback);
        return localVarCall;

    }

    /**
     * Delete project search
     * 
     * @param owner Owner of the namespace (required)
     * @param entity Entity: project name, hub name, registry name, ... (required)
     * @param uuid Uuid identifier of the sub-entity (required)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public void deleteProjectSearch(String owner, String entity, String uuid) throws ApiException {
        deleteProjectSearchWithHttpInfo(owner, entity, uuid);
    }

    /**
     * Delete project search
     * 
     * @param owner Owner of the namespace (required)
     * @param entity Entity: project name, hub name, registry name, ... (required)
     * @param uuid Uuid identifier of the sub-entity (required)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<Void> deleteProjectSearchWithHttpInfo(String owner, String entity, String uuid) throws ApiException {
        okhttp3.Call localVarCall = deleteProjectSearchValidateBeforeCall(owner, entity, uuid, null);
        return localVarApiClient.execute(localVarCall);
    }

    /**
     * Delete project search (asynchronously)
     * 
     * @param owner Owner of the namespace (required)
     * @param entity Entity: project name, hub name, registry name, ... (required)
     * @param uuid Uuid identifier of the sub-entity (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call deleteProjectSearchAsync(String owner, String entity, String uuid, final ApiCallback<Void> _callback) throws ApiException {

        okhttp3.Call localVarCall = deleteProjectSearchValidateBeforeCall(owner, entity, uuid, _callback);
        localVarApiClient.executeAsync(localVarCall, _callback);
        return localVarCall;
    }
    /**
     * Build call for getProjectSearch
     * @param owner Owner of the namespace (required)
     * @param entity Entity: project name, hub name, registry name, ... (required)
     * @param uuid Uuid identifier of the sub-entity (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getProjectSearchCall(String owner, String entity, String uuid, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/api/v1/{owner}/{entity}/searches/{uuid}"
            .replaceAll("\\{" + "owner" + "\\}", localVarApiClient.escapeString(owner.toString()))
            .replaceAll("\\{" + "entity" + "\\}", localVarApiClient.escapeString(entity.toString()))
            .replaceAll("\\{" + "uuid" + "\\}", localVarApiClient.escapeString(uuid.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getProjectSearchValidateBeforeCall(String owner, String entity, String uuid, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'owner' is set
        if (owner == null) {
            throw new ApiException("Missing the required parameter 'owner' when calling getProjectSearch(Async)");
        }
        
        // verify the required parameter 'entity' is set
        if (entity == null) {
            throw new ApiException("Missing the required parameter 'entity' when calling getProjectSearch(Async)");
        }
        
        // verify the required parameter 'uuid' is set
        if (uuid == null) {
            throw new ApiException("Missing the required parameter 'uuid' when calling getProjectSearch(Async)");
        }
        

        okhttp3.Call localVarCall = getProjectSearchCall(owner, entity, uuid, _callback);
        return localVarCall;

    }

    /**
     * Get project search
     * 
     * @param owner Owner of the namespace (required)
     * @param entity Entity: project name, hub name, registry name, ... (required)
     * @param uuid Uuid identifier of the sub-entity (required)
     * @return V1Search
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public V1Search getProjectSearch(String owner, String entity, String uuid) throws ApiException {
        ApiResponse<V1Search> localVarResp = getProjectSearchWithHttpInfo(owner, entity, uuid);
        return localVarResp.getData();
    }

    /**
     * Get project search
     * 
     * @param owner Owner of the namespace (required)
     * @param entity Entity: project name, hub name, registry name, ... (required)
     * @param uuid Uuid identifier of the sub-entity (required)
     * @return ApiResponse&lt;V1Search&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<V1Search> getProjectSearchWithHttpInfo(String owner, String entity, String uuid) throws ApiException {
        okhttp3.Call localVarCall = getProjectSearchValidateBeforeCall(owner, entity, uuid, null);
        Type localVarReturnType = new TypeToken<V1Search>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Get project search (asynchronously)
     * 
     * @param owner Owner of the namespace (required)
     * @param entity Entity: project name, hub name, registry name, ... (required)
     * @param uuid Uuid identifier of the sub-entity (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getProjectSearchAsync(String owner, String entity, String uuid, final ApiCallback<V1Search> _callback) throws ApiException {

        okhttp3.Call localVarCall = getProjectSearchValidateBeforeCall(owner, entity, uuid, _callback);
        Type localVarReturnType = new TypeToken<V1Search>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for listProjectSearchNames
     * @param owner Owner of the namespace (required)
     * @param name Entity managing the resource (required)
     * @param offset Pagination offset. (optional)
     * @param limit Limit size. (optional)
     * @param sort Sort to order the search. (optional)
     * @param query Query filter the search. (optional)
     * @param mode Mode the search. (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call listProjectSearchNamesCall(String owner, String name, Integer offset, Integer limit, String sort, String query, String mode, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/api/v1/{owner}/{name}/searches/names"
            .replaceAll("\\{" + "owner" + "\\}", localVarApiClient.escapeString(owner.toString()))
            .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (offset != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset));
        }

        if (limit != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit));
        }

        if (sort != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
        }

        if (query != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("query", query));
        }

        if (mode != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("mode", mode));
        }

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call listProjectSearchNamesValidateBeforeCall(String owner, String name, Integer offset, Integer limit, String sort, String query, String mode, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'owner' is set
        if (owner == null) {
            throw new ApiException("Missing the required parameter 'owner' when calling listProjectSearchNames(Async)");
        }
        
        // verify the required parameter 'name' is set
        if (name == null) {
            throw new ApiException("Missing the required parameter 'name' when calling listProjectSearchNames(Async)");
        }
        

        okhttp3.Call localVarCall = listProjectSearchNamesCall(owner, name, offset, limit, sort, query, mode, _callback);
        return localVarCall;

    }

    /**
     * List project search names
     * 
     * @param owner Owner of the namespace (required)
     * @param name Entity managing the resource (required)
     * @param offset Pagination offset. (optional)
     * @param limit Limit size. (optional)
     * @param sort Sort to order the search. (optional)
     * @param query Query filter the search. (optional)
     * @param mode Mode the search. (optional)
     * @return V1ListSearchesResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public V1ListSearchesResponse listProjectSearchNames(String owner, String name, Integer offset, Integer limit, String sort, String query, String mode) throws ApiException {
        ApiResponse<V1ListSearchesResponse> localVarResp = listProjectSearchNamesWithHttpInfo(owner, name, offset, limit, sort, query, mode);
        return localVarResp.getData();
    }

    /**
     * List project search names
     * 
     * @param owner Owner of the namespace (required)
     * @param name Entity managing the resource (required)
     * @param offset Pagination offset. (optional)
     * @param limit Limit size. (optional)
     * @param sort Sort to order the search. (optional)
     * @param query Query filter the search. (optional)
     * @param mode Mode the search. (optional)
     * @return ApiResponse&lt;V1ListSearchesResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<V1ListSearchesResponse> listProjectSearchNamesWithHttpInfo(String owner, String name, Integer offset, Integer limit, String sort, String query, String mode) throws ApiException {
        okhttp3.Call localVarCall = listProjectSearchNamesValidateBeforeCall(owner, name, offset, limit, sort, query, mode, null);
        Type localVarReturnType = new TypeToken<V1ListSearchesResponse>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * List project search names (asynchronously)
     * 
     * @param owner Owner of the namespace (required)
     * @param name Entity managing the resource (required)
     * @param offset Pagination offset. (optional)
     * @param limit Limit size. (optional)
     * @param sort Sort to order the search. (optional)
     * @param query Query filter the search. (optional)
     * @param mode Mode the search. (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call listProjectSearchNamesAsync(String owner, String name, Integer offset, Integer limit, String sort, String query, String mode, final ApiCallback<V1ListSearchesResponse> _callback) throws ApiException {

        okhttp3.Call localVarCall = listProjectSearchNamesValidateBeforeCall(owner, name, offset, limit, sort, query, mode, _callback);
        Type localVarReturnType = new TypeToken<V1ListSearchesResponse>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for listProjectSearches
     * @param owner Owner of the namespace (required)
     * @param name Entity managing the resource (required)
     * @param offset Pagination offset. (optional)
     * @param limit Limit size. (optional)
     * @param sort Sort to order the search. (optional)
     * @param query Query filter the search. (optional)
     * @param mode Mode the search. (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call listProjectSearchesCall(String owner, String name, Integer offset, Integer limit, String sort, String query, String mode, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/api/v1/{owner}/{name}/searches"
            .replaceAll("\\{" + "owner" + "\\}", localVarApiClient.escapeString(owner.toString()))
            .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (offset != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset));
        }

        if (limit != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit));
        }

        if (sort != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
        }

        if (query != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("query", query));
        }

        if (mode != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("mode", mode));
        }

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call listProjectSearchesValidateBeforeCall(String owner, String name, Integer offset, Integer limit, String sort, String query, String mode, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'owner' is set
        if (owner == null) {
            throw new ApiException("Missing the required parameter 'owner' when calling listProjectSearches(Async)");
        }
        
        // verify the required parameter 'name' is set
        if (name == null) {
            throw new ApiException("Missing the required parameter 'name' when calling listProjectSearches(Async)");
        }
        

        okhttp3.Call localVarCall = listProjectSearchesCall(owner, name, offset, limit, sort, query, mode, _callback);
        return localVarCall;

    }

    /**
     * List project searches
     * 
     * @param owner Owner of the namespace (required)
     * @param name Entity managing the resource (required)
     * @param offset Pagination offset. (optional)
     * @param limit Limit size. (optional)
     * @param sort Sort to order the search. (optional)
     * @param query Query filter the search. (optional)
     * @param mode Mode the search. (optional)
     * @return V1ListSearchesResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public V1ListSearchesResponse listProjectSearches(String owner, String name, Integer offset, Integer limit, String sort, String query, String mode) throws ApiException {
        ApiResponse<V1ListSearchesResponse> localVarResp = listProjectSearchesWithHttpInfo(owner, name, offset, limit, sort, query, mode);
        return localVarResp.getData();
    }

    /**
     * List project searches
     * 
     * @param owner Owner of the namespace (required)
     * @param name Entity managing the resource (required)
     * @param offset Pagination offset. (optional)
     * @param limit Limit size. (optional)
     * @param sort Sort to order the search. (optional)
     * @param query Query filter the search. (optional)
     * @param mode Mode the search. (optional)
     * @return ApiResponse&lt;V1ListSearchesResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<V1ListSearchesResponse> listProjectSearchesWithHttpInfo(String owner, String name, Integer offset, Integer limit, String sort, String query, String mode) throws ApiException {
        okhttp3.Call localVarCall = listProjectSearchesValidateBeforeCall(owner, name, offset, limit, sort, query, mode, null);
        Type localVarReturnType = new TypeToken<V1ListSearchesResponse>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * List project searches (asynchronously)
     * 
     * @param owner Owner of the namespace (required)
     * @param name Entity managing the resource (required)
     * @param offset Pagination offset. (optional)
     * @param limit Limit size. (optional)
     * @param sort Sort to order the search. (optional)
     * @param query Query filter the search. (optional)
     * @param mode Mode the search. (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call listProjectSearchesAsync(String owner, String name, Integer offset, Integer limit, String sort, String query, String mode, final ApiCallback<V1ListSearchesResponse> _callback) throws ApiException {

        okhttp3.Call localVarCall = listProjectSearchesValidateBeforeCall(owner, name, offset, limit, sort, query, mode, _callback);
        Type localVarReturnType = new TypeToken<V1ListSearchesResponse>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for patchProjectSearch
     * @param owner Owner of the namespace (required)
     * @param project Project under namesapce (required)
     * @param searchUuid UUID (required)
     * @param body Search body (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call patchProjectSearchCall(String owner, String project, String searchUuid, V1Search body, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/api/v1/{owner}/{project}/searches/{search.uuid}"
            .replaceAll("\\{" + "owner" + "\\}", localVarApiClient.escapeString(owner.toString()))
            .replaceAll("\\{" + "project" + "\\}", localVarApiClient.escapeString(project.toString()))
            .replaceAll("\\{" + "search.uuid" + "\\}", localVarApiClient.escapeString(searchUuid.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call patchProjectSearchValidateBeforeCall(String owner, String project, String searchUuid, V1Search body, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'owner' is set
        if (owner == null) {
            throw new ApiException("Missing the required parameter 'owner' when calling patchProjectSearch(Async)");
        }
        
        // verify the required parameter 'project' is set
        if (project == null) {
            throw new ApiException("Missing the required parameter 'project' when calling patchProjectSearch(Async)");
        }
        
        // verify the required parameter 'searchUuid' is set
        if (searchUuid == null) {
            throw new ApiException("Missing the required parameter 'searchUuid' when calling patchProjectSearch(Async)");
        }
        
        // verify the required parameter 'body' is set
        if (body == null) {
            throw new ApiException("Missing the required parameter 'body' when calling patchProjectSearch(Async)");
        }
        

        okhttp3.Call localVarCall = patchProjectSearchCall(owner, project, searchUuid, body, _callback);
        return localVarCall;

    }

    /**
     * Patch project search
     * 
     * @param owner Owner of the namespace (required)
     * @param project Project under namesapce (required)
     * @param searchUuid UUID (required)
     * @param body Search body (required)
     * @return V1Search
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public V1Search patchProjectSearch(String owner, String project, String searchUuid, V1Search body) throws ApiException {
        ApiResponse<V1Search> localVarResp = patchProjectSearchWithHttpInfo(owner, project, searchUuid, body);
        return localVarResp.getData();
    }

    /**
     * Patch project search
     * 
     * @param owner Owner of the namespace (required)
     * @param project Project under namesapce (required)
     * @param searchUuid UUID (required)
     * @param body Search body (required)
     * @return ApiResponse&lt;V1Search&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<V1Search> patchProjectSearchWithHttpInfo(String owner, String project, String searchUuid, V1Search body) throws ApiException {
        okhttp3.Call localVarCall = patchProjectSearchValidateBeforeCall(owner, project, searchUuid, body, null);
        Type localVarReturnType = new TypeToken<V1Search>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Patch project search (asynchronously)
     * 
     * @param owner Owner of the namespace (required)
     * @param project Project under namesapce (required)
     * @param searchUuid UUID (required)
     * @param body Search body (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call patchProjectSearchAsync(String owner, String project, String searchUuid, V1Search body, final ApiCallback<V1Search> _callback) throws ApiException {

        okhttp3.Call localVarCall = patchProjectSearchValidateBeforeCall(owner, project, searchUuid, body, _callback);
        Type localVarReturnType = new TypeToken<V1Search>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for promoteProjectSearch
     * @param owner Owner of the namespace (required)
     * @param entity Entity: project name, hub name, registry name, ... (required)
     * @param uuid Uuid identifier of the sub-entity (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call promoteProjectSearchCall(String owner, String entity, String uuid, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/api/v1/{owner}/{entity}/searches/{uuid}/promote"
            .replaceAll("\\{" + "owner" + "\\}", localVarApiClient.escapeString(owner.toString()))
            .replaceAll("\\{" + "entity" + "\\}", localVarApiClient.escapeString(entity.toString()))
            .replaceAll("\\{" + "uuid" + "\\}", localVarApiClient.escapeString(uuid.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call promoteProjectSearchValidateBeforeCall(String owner, String entity, String uuid, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'owner' is set
        if (owner == null) {
            throw new ApiException("Missing the required parameter 'owner' when calling promoteProjectSearch(Async)");
        }
        
        // verify the required parameter 'entity' is set
        if (entity == null) {
            throw new ApiException("Missing the required parameter 'entity' when calling promoteProjectSearch(Async)");
        }
        
        // verify the required parameter 'uuid' is set
        if (uuid == null) {
            throw new ApiException("Missing the required parameter 'uuid' when calling promoteProjectSearch(Async)");
        }
        

        okhttp3.Call localVarCall = promoteProjectSearchCall(owner, entity, uuid, _callback);
        return localVarCall;

    }

    /**
     * Promote project search
     * 
     * @param owner Owner of the namespace (required)
     * @param entity Entity: project name, hub name, registry name, ... (required)
     * @param uuid Uuid identifier of the sub-entity (required)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public void promoteProjectSearch(String owner, String entity, String uuid) throws ApiException {
        promoteProjectSearchWithHttpInfo(owner, entity, uuid);
    }

    /**
     * Promote project search
     * 
     * @param owner Owner of the namespace (required)
     * @param entity Entity: project name, hub name, registry name, ... (required)
     * @param uuid Uuid identifier of the sub-entity (required)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<Void> promoteProjectSearchWithHttpInfo(String owner, String entity, String uuid) throws ApiException {
        okhttp3.Call localVarCall = promoteProjectSearchValidateBeforeCall(owner, entity, uuid, null);
        return localVarApiClient.execute(localVarCall);
    }

    /**
     * Promote project search (asynchronously)
     * 
     * @param owner Owner of the namespace (required)
     * @param entity Entity: project name, hub name, registry name, ... (required)
     * @param uuid Uuid identifier of the sub-entity (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call promoteProjectSearchAsync(String owner, String entity, String uuid, final ApiCallback<Void> _callback) throws ApiException {

        okhttp3.Call localVarCall = promoteProjectSearchValidateBeforeCall(owner, entity, uuid, _callback);
        localVarApiClient.executeAsync(localVarCall, _callback);
        return localVarCall;
    }
    /**
     * Build call for updateProjectSearch
     * @param owner Owner of the namespace (required)
     * @param project Project under namesapce (required)
     * @param searchUuid UUID (required)
     * @param body Search body (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call updateProjectSearchCall(String owner, String project, String searchUuid, V1Search body, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/api/v1/{owner}/{project}/searches/{search.uuid}"
            .replaceAll("\\{" + "owner" + "\\}", localVarApiClient.escapeString(owner.toString()))
            .replaceAll("\\{" + "project" + "\\}", localVarApiClient.escapeString(project.toString()))
            .replaceAll("\\{" + "search.uuid" + "\\}", localVarApiClient.escapeString(searchUuid.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call updateProjectSearchValidateBeforeCall(String owner, String project, String searchUuid, V1Search body, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'owner' is set
        if (owner == null) {
            throw new ApiException("Missing the required parameter 'owner' when calling updateProjectSearch(Async)");
        }
        
        // verify the required parameter 'project' is set
        if (project == null) {
            throw new ApiException("Missing the required parameter 'project' when calling updateProjectSearch(Async)");
        }
        
        // verify the required parameter 'searchUuid' is set
        if (searchUuid == null) {
            throw new ApiException("Missing the required parameter 'searchUuid' when calling updateProjectSearch(Async)");
        }
        
        // verify the required parameter 'body' is set
        if (body == null) {
            throw new ApiException("Missing the required parameter 'body' when calling updateProjectSearch(Async)");
        }
        

        okhttp3.Call localVarCall = updateProjectSearchCall(owner, project, searchUuid, body, _callback);
        return localVarCall;

    }

    /**
     * Update project search
     * 
     * @param owner Owner of the namespace (required)
     * @param project Project under namesapce (required)
     * @param searchUuid UUID (required)
     * @param body Search body (required)
     * @return V1Search
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public V1Search updateProjectSearch(String owner, String project, String searchUuid, V1Search body) throws ApiException {
        ApiResponse<V1Search> localVarResp = updateProjectSearchWithHttpInfo(owner, project, searchUuid, body);
        return localVarResp.getData();
    }

    /**
     * Update project search
     * 
     * @param owner Owner of the namespace (required)
     * @param project Project under namesapce (required)
     * @param searchUuid UUID (required)
     * @param body Search body (required)
     * @return ApiResponse&lt;V1Search&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<V1Search> updateProjectSearchWithHttpInfo(String owner, String project, String searchUuid, V1Search body) throws ApiException {
        okhttp3.Call localVarCall = updateProjectSearchValidateBeforeCall(owner, project, searchUuid, body, null);
        Type localVarReturnType = new TypeToken<V1Search>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Update project search (asynchronously)
     * 
     * @param owner Owner of the namespace (required)
     * @param project Project under namesapce (required)
     * @param searchUuid UUID (required)
     * @param body Search body (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call updateProjectSearchAsync(String owner, String project, String searchUuid, V1Search body, final ApiCallback<V1Search> _callback) throws ApiException {

        okhttp3.Call localVarCall = updateProjectSearchValidateBeforeCall(owner, project, searchUuid, body, _callback);
        Type localVarReturnType = new TypeToken<V1Search>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
}
